<!--
 * @Description: 
 * @Date: 2025-07-07 10:53:29
 * @LastEditTime: 2025-08-12 16:11:39
-->
<template>
    <van-nav-bar left-text="返回" title="盘查详情" left-arrow @click-left="onClickLeft">

    </van-nav-bar>
    <div>
        <div style="padding:0 18px 18px 0;display: flex;flex-direction: column;gap: 10px;">
            <van-cell-group>
                <van-field v-model="formState.target.assetTag" readonly="true" label="资产标签号:" />
                <van-field v-model="formState.target.equipmentName" readonly="true" label="资产名称:" />
                <van-field v-model="formState.target.specificLocation" readonly="true" label="具体位置:" />
                <van-field v-model="formState.target.responsiblePersonId" readonly="true" label="责任人编号:" />
                <van-field v-model="formState.target.responsiblePersonName" readonly="true" label="责任人姓名:" />
            </van-cell-group>
            <van-cell-group>
                <van-field v-model="formState.signature" type="textarea"  readonly="true" label="盘查地点:" />
                <van-field v-model="formState.checkPersonName" readonly="true" label="盘查人员:" />
                <van-field v-model="formState.createTime" readonly="true" label="盘查时间:" />
                
                <van-field v-model="formState.checkResult" readonly="true" label="是否合格:">
                    <template v-slot:input>
                        <van-tag plain type="primary" size="large" v-if="formState.checkResult">合格</van-tag>
                        <van-tag plain type="danger" size="large" v-else>不合格</van-tag>
                    </template>

                </van-field>
                <van-field v-model="formState.checkNotes" type="textarea"  readonly="true" label="情况说明:" />
                <van-field v-model="formState.checkResult" style="display: flex;flex-direction: column;" readonly="true" label="现场图片:">
                    <template v-slot:input>
                        <div style="display: grid;grid-template-columns: 1fr 1fr; gap: 10px; ">
                        <img style="width: 100%;height: 200px;" v-for="img in formState.urls"
                            :src="img.replace('http://10.131.231.114:8080', 'https://sn.wgt.10086.cn')" @click="showImg(img.replace('http://10.131.231.114:8080', 'https://sn.wgt.10086.cn'))"/>
                    </div>
                    </template>
                </van-field>

            </van-cell-group>
        </div>
    </div>
</template>
<script setup>
import { ImagePreview } from 'vant';
import { useRoute } from "vue-router";
import { ref, onMounted } from "vue"
import EquipmentEditApi from "../equipmentEdit/api/equipmentEdit"
import icon from "../../assets/img/icon1 (2).png"
const formState = ref({
    target: "",
    urls:""
})
const route = useRoute()
const onClickLeft = () => history.back();
onMounted(() => {
    EquipmentEditApi.equipmenttableCheckDetail(route.query.id).then(res => {
        if (res.data.code == 200) {
            formState.value = Object.assign({}, res.data.data)
        }
    })
})
const showImg = (url) => {
  ImagePreview([
    url
  ]);
}
</script>
<style>
.groupTitle {
    width: 50%;
    font-weight: bold;
    color: #000;
}
</style>